public class MinStackTest {
    public static void main(String[] args) {
        // 创建最小栈实例
        MinStack minStack = new MinStack();


        // 测试1: 压入元素
        System.out.println("\n测试1: 压入元素 -2, 0 ,1,-3, -3");
        minStack.push(-2);
        minStack.push(0);
        minStack.push(1);
        minStack.push(-3);
        minStack.push(-3);
        System.out.println(minStack.top());// -3
        System.out.println(minStack.getMin());// -3

        // 弹出元素
        System.out.println("\n测试: 第一次弹出元素");
        minStack.pop();
        System.out.println(minStack.top());// -3
        System.out.println(minStack.getMin());// -3

        System.out.println("\n测试: 第二次弹出元素");
        minStack.pop();
        System.out.println(minStack.top());// 1
        System.out.println(minStack.getMin());// -2

        System.out.println("\n测试: 第三次弹出元素");
        minStack.pop();
        System.out.println(minStack.top());// 0
        System.out.println(minStack.getMin());// -2

        System.out.println("\n测试: 第四次弹出元素");
        minStack.pop();
        System.out.println(minStack.top());// -2
        System.out.println(minStack.getMin());// -2

    }
}